//package com.tubang.logistics.controller.order;
//
//
//import com.baomidou.mybatisplus.mapper.EntityWrapper;
//import com.baomidou.mybatisplus.plugins.Page;
//import com.tubang.common.constant.Constants;
//import com.tubang.common.util.*;
//import com.tubang.component.entity.AddressEntity;
//import com.tubang.component.service.IAddressService;
//import com.tubang.component.util.RequestUtil;
//import com.tubang.logistics.entity.*;
//import com.tubang.logistics.service.*;
//import com.tubang.logistics.vo.*;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.math.BigDecimal;
//import java.text.DecimalFormat;
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.List;
//
///**
// * <p>
// * 运单控制器
// * </p>
// *
// * @author wsl
// * @since 2017-12-31
// */
//@RestController
//@RequestMapping("/truckerOrder")
//public class OrderTruckerController {
//
//    private Logger logger = LoggerFactory.getLogger(getClass());
//
//    @Resource
//    private IGoodsService goodsService;
//
//
//    @Resource
//    private IAddressService addressService;
//
//
//    @Resource
//    private ITransportService transportService;
//
//
//    @Resource
//    private ITruckerOrderService truckerOrderService;
//
//
//    @Resource
//    private ITruckerOrderGoodsService truckerOrderGoodsService;
//
//    @Resource
//    private IPlatformOrderService platformOrderService;
//
//    @Resource
//    private ILogisticsOrderService logisticsOrderServices;
//
//    @Resource
//    private IPlatformOrderGoodsService platformOrderGoodsService;
//
//
//    /**
//     * 货源中心-列表 抢单 竞价 指派
//     *
//     * @param
//     * @return
//     */
//    @GetMapping(value = "truckerSuppList")
//    public ResultData truckerSuppList(@RequestParam(required = false) String addrFrom,
//                                      @RequestParam(required = false) String addrTo,
//                                      @RequestParam(required = false) String num,
//                                      @RequestParam(required = false) String statusCode,//逗号隔开的  需要处理
//                                      @RequestParam(required = false) String companyId, // 司机 id
//                                      @RequestParam(required = false) String userId, // 平台 id  公司 id
//                                      @RequestParam(required = false) String containerType,//车辆类型
//                                      @RequestParam(required = false) String containerSize,//车辆长度
//                                      @RequestParam(required = false, defaultValue = "1") Integer page,
//                                      @RequestParam(required = false, defaultValue = "10") Integer rows) {
//        try {
//            List<OrderListVo> orderSupplyListVos = new ArrayList<OrderListVo>();
//
//            //条件查询
//            EntityWrapper<PlatformOrderEntity> platformWrapper = new EntityWrapper<PlatformOrderEntity>();
//            if (StringUtils.isNotEmpty(num)) {
//                platformWrapper.eq("num", num);
//            }
//            if (StringUtils.isNotEmpty(statusCode)) {
//                if (Constants.ORDER_STATUS_DESIGNATE.equals(statusCode)) {
//                    platformWrapper.eq("carrier_id", companyId).eq("status_code", statusCode);
//                } else {
//                    platformWrapper.eq("status_code", statusCode);
//                }
//            }
//            if (StringUtils.isNotEmpty(addrFrom)) {
//                platformWrapper.like("addr_from", addrFrom);
//            }
//
//
//            if (StringUtils.isNotEmpty(addrTo)) {
//                platformWrapper.like("addr_to", addrTo);
//            }
//
//            if (StringUtils.isNotEmpty(containerType)) {
//                platformWrapper.eq("container_type", containerType);
//            }
//
//            if (StringUtils.isNotEmpty(containerSize)) {
//                platformWrapper.eq("container_size", containerSize);
//            }
//
//
//            Page<PlatformOrderEntity> platformOrderPage = platformOrderService.selectPage(new Page<PlatformOrderEntity>(page, rows), platformWrapper);
//            int platformCount = platformOrderService.selectCount(platformWrapper);
//
//            List<OrderListVo> platformOrderSupplyListVos = BeanMapper.mapList(platformOrderPage.getRecords(), OrderListVo.class);
//            for (OrderListVo orderSupplyListVo : platformOrderSupplyListVos) {
//                String orderId = orderSupplyListVo.getId();
//                List<PlatformOrderGoodsEntity> platformOrderGoodsEntities = platformOrderGoodsService.selectOrderByOrderId(orderId);
//                //所有货品
//                String goodName = Constants.DEFAULT_STRING;
//                BigDecimal weight = new BigDecimal(0);
//                GoodsEntity goodsBasic = new GoodsEntity();
//                for (PlatformOrderGoodsEntity platformOrderGoodsEntity : platformOrderGoodsEntities) {
//                    goodsBasic = goodsService.selectBaseGoodsByGoodsId(platformOrderGoodsEntity.getGoodsId());
//                    //重量  名称
//                    if (goodsBasic != null) {
//                        goodName = goodsBasic.getName();
//                        weight = goodsBasic.getWeight();
//                    }
//                }
//                //查询商品名称-
//                orderSupplyListVo.setGoodsName(goodName);
//                orderSupplyListVo.setWeight(String.valueOf(weight));
//                TransportEntity transportEntity = transportService.selectByOrderId(goodsBasic.getShipperOrderId());
//                //地址
//                if (transportEntity != null) {
//                    AddressEntity from = addressService.selectById(transportEntity.getFromUserAddressId());
//                    AddressEntity to = addressService.selectById(transportEntity.getToUserAddressId());
//                    orderSupplyListVo.setAddressFrom(from);
//                    orderSupplyListVo.setAddresTo(to);
//                }
//                orderSupplyListVo.setOrderType(Constants.USER_TYPE_OUTSIDE_PLATFORM);
//            }
//
//
//            EntityWrapper<LogisticsOrderEntity> logisticswrapper = new EntityWrapper<>();
//
//            if (StringUtils.isNotEmpty(num)) {
//                logisticswrapper.eq("num", num);
//            }
//            if (StringUtils.isNotEmpty(statusCode)) {
//                if (Constants.ORDER_STATUS_DESIGNATE.equals(statusCode)) {
//                    logisticswrapper.eq("carrier_id", companyId).eq("status_code", statusCode);
//                } else {
//                    logisticswrapper.eq("status_code", statusCode);
//                }
//            }
//
//            if (StringUtils.isNotEmpty(userId)) {
//                logisticswrapper.in("user_id", userId);
//            }
//
//            if (StringUtils.isNotEmpty(addrFrom)) {
//                logisticswrapper.like("addr_from", addrFrom);
//            }
//
//
//            if (StringUtils.isNotEmpty(addrTo)) {
//                logisticswrapper.like("addr_to", addrTo);
//            }
//
//            if (StringUtils.isNotEmpty(containerType)) {
//                logisticswrapper.eq("container_type", containerType);
//            }
//
//            if (StringUtils.isNotEmpty(containerSize)) {
//                logisticswrapper.eq("container_size", containerSize);
//            }
//
////            if (StringUtils.isNotEmpty(companyId)) {
////                platformWrapper.or().in("carrier_id", companyId).eq("status_code",Constants.ORDER_STATUS_DESIGNATE);
////            }
//
//            int logisticsCount = logisticsOrderServices.selectCount(logisticswrapper);
//            Page<LogisticsOrderEntity> logisticsOrderPage = logisticsOrderServices.selectPage(new Page(page, rows), logisticswrapper);
//            List<OrderListVo> logisticsOrderListVos = BeanMapper.mapList(logisticsOrderPage.getRecords(), OrderListVo.class);
//            for (OrderListVo lo : logisticsOrderListVos) {
//                try {
//
//                    GoodsEntity goodsEntity = goodsService.selectBaseGoodsByLogisticsOrderId(lo.getId());
//                    TransportEntity transportEntity = transportService.selectById(goodsEntity.getTransportId());
//                    lo.setGoodsName(goodsEntity.getName());
//                    lo.setWeight(String.valueOf(goodsEntity.getWeight()));
//                    AddressEntity fAddressEntity = addressService.selectById(transportEntity.getFromUserAddressId());
//                    AddressEntity tAddressEntity = addressService.selectById(transportEntity.getToUserAddressId());
//                    lo.setAddressFrom(fAddressEntity);
//                    lo.setAddresTo(tAddressEntity);
//                    lo.setOrderType(Constants.USER_TYPE_OUTSIDE_COMPANY);
//                } catch (Exception e) {
//                    e.printStackTrace();
//                    logger.error("数据加工失败，物流公司运单编号为：{}==,,失败原因为{}", lo.getId(), e.getMessage());
//                    return ResultData.result(false).setData(e);
//                }
//            }
//
//            orderSupplyListVos.addAll(platformOrderSupplyListVos);
//            orderSupplyListVos.addAll(logisticsOrderListVos);
//            return ResultData.result(true).setData(orderSupplyListVos).setTotalCount(platformCount + logisticsCount);
//        } catch (Exception e)
//
//        {
//            logger.error("[OrderTruckerController]<== method[truckerList], 更新状态失败 :[{}]", e.getMessage());
//            e.printStackTrace();
//            return ResultData.result(false).setData(e);
//        }
//    }
//
//    /**
//     * 订单 运单列表
//     *
//     * @param
//     * @return
//     */
//    @GetMapping(value = "truckerList")
//    public ResultData truckerList(@RequestParam(required = false) String addrFrom,
//                                  @RequestParam(required = false) String addrTo,
//                                  @RequestParam(required = false) String num,
//                                  @RequestParam(required = false) String statusCode,//逗号隔开的  需要处理
//                                  @RequestParam(required = false) String companyId, // 司机 id
//                                  @RequestParam(required = false) String userId, // 平台 id  公司 id
//                                  @RequestParam(required = false, defaultValue = "1") Integer page,
//                                  @RequestParam(required = false, defaultValue = "10") Integer rows) {
//        try {
//
//            //
//            EntityWrapper<TruckerOrderEntity> entityWrapper = new EntityWrapper<TruckerOrderEntity>();
//            if (StringUtils.isNotEmpty(num)) {
//                entityWrapper.eq("num", num);
//            }
//            if (StringUtils.isNotEmpty(statusCode)) {
//                String[] split = statusCode.split(",");
//                entityWrapper.in("status_code", split);
//            }
//
//            if (StringUtils.isNotEmpty(companyId)) {
//                entityWrapper.eq("carrier_id", companyId);
//            }
//
//            if (StringUtils.isNotEmpty(addrFrom)) {
//                entityWrapper.like("addr_from", addrFrom);
//            }
//
//
//            if (StringUtils.isNotEmpty(addrTo)) {
//                entityWrapper.like("addr_to", addrTo);
//            }
//
//
//            if (StringUtils.isNotEmpty(userId)) {
//                entityWrapper.like("user_id", userId);
//            }
//
//
//            Page<TruckerOrderEntity> truckerOrderEntityPage = truckerOrderService.selectPage(new Page<TruckerOrderEntity>(page, rows), entityWrapper);
//            List<TruckerOrderEntity> records = truckerOrderEntityPage.getRecords();
//            List<OrderListVo> orderListVos = new ArrayList<OrderListVo>();
//            for (TruckerOrderEntity truckerOrderEntity : records) {
//                String orderId = truckerOrderEntity.getId();
//                OrderListVo orderListVo=new OrderListVo();
//                BeanMapper.copy(truckerOrderEntity,orderListVo);
//                //orderListVo.setGoodsWeight(truckerOrderEntity.getGoodsWeight());
//                //orderListVo.setCarriage(truckerOrderEntity.getCarriage());
//                GoodsEntity goodsBasic = new GoodsEntity();
//                List<TruckerOrderGoodsEntity> truckerOrderGoodsEntitys = truckerOrderGoodsService.selectOrderByOrderId(orderId);
//                for (TruckerOrderGoodsEntity truckerOrderGoodsEntity : truckerOrderGoodsEntitys) {
//                    goodsBasic = goodsService.selectBaseGoodsByGoodsId(truckerOrderGoodsEntity.getGoodsId());
//
//                }
//                TransportEntity transportEntity = transportService.selectByOrderId(goodsBasic.getShipperOrderId());
//                //地址
//                if (transportEntity != null) {
//                    AddressEntity from = addressService.selectById(transportEntity.getFromUserAddressId());
//                    AddressEntity to = addressService.selectById(transportEntity.getToUserAddressId());
//                    orderListVo.setAddressFrom(from);
//                    orderListVo.setAddresTo(to);
//                    BeanMapper.copy(transportEntity,orderListVo);
//                }
//                orderListVo.setId(orderId);
//                orderListVo.setWeight(String.valueOf(truckerOrderEntity.getGoodsWeight()));
//                orderListVos.add(orderListVo);
//            }
//
//            int count = truckerOrderService.selectCount(entityWrapper);
//
//            return ResultData.result(true).setData(orderListVos).setTotalCount(count);
//        } catch (Exception e) {
//            logger.error("[OrderTruckerController]<== method[truckerList], 更新状态失败 :[{}]", e.getMessage());
//            e.printStackTrace();
//            return ResultData.result(false).setData(e);
//        }
//    }
//
//
//    /**
//     * 运单详情
//     *
//     * @param
//     * @return
//     */
//    @GetMapping(value = "truckerOrderInfo")
//    public ResultData truckerOrderInfo(@RequestParam(required = false) String orderId,
//                                       @RequestParam(required = false) String orderType) {
//        try {
//            OrderbillInfoVo orderbillInfoVo = new OrderbillInfoVo();
//            List<GoodsEntity> goodsEntities = new ArrayList<GoodsEntity>();
//            GoodsEntity baseGoods = null;
//            GoodsBaseVo goodsBaseVo = new GoodsBaseVo();
//            DecimalFormat decimalFormat = new DecimalFormat("######0.000");
//            if (Constants.USER_TYPE_OUTSIDE_COMPANY.equals(orderType)) {
//                //物流公司
//                LogisticsOrderEntity logisticsOrderEntity = logisticsOrderServices.selectById(orderId);
//                BeanMapper.copy(logisticsOrderEntity, orderbillInfoVo);
//                goodsEntities = goodsService.selectGoodssByLogisticsOrderId(orderId);
//                baseGoods = goodsService.selectBaseGoodsByLogisticsOrderId(orderId);
//                if (baseGoods != null) {
//                    BeanMapper.copy(baseGoods, goodsBaseVo);
//                    goodsBaseVo.setName(logisticsOrderEntity.getGoodsName());
//                    goodsBaseVo.setWeight( new BigDecimal(decimalFormat.format(logisticsOrderEntity.getGoodsWeight())));
//                    goodsBaseVo.setLeftWeight(new BigDecimal(decimalFormat.format(logisticsOrderEntity.getGoodsWeight())));
//                    orderbillInfoVo.setGoodsBaseVo(goodsBaseVo);
//
//                }
//
//            } else if (Constants.USER_TYPE_OUTSIDE_PLATFORM.equals(orderType)) {
//                //平台
//                PlatformOrderEntity platformOrderEntity = platformOrderService.selectById(orderId);
//                BeanMapper.copy(platformOrderEntity, orderbillInfoVo);
//                goodsEntities = goodsService.selectGoodssByPlatFormOrderId(orderId, null);
//                baseGoods = goodsService.selectBaseGoodsByPlatFormOrderId(orderId);
//                if (baseGoods != null) {
//                    BeanMapper.copy(baseGoods, goodsBaseVo);
//                    goodsBaseVo.setName(platformOrderEntity.getGoodsName());
//                    goodsBaseVo.setWeight(new BigDecimal(decimalFormat.format(platformOrderEntity.getGoodsWeight())));
//                    goodsBaseVo.setLeftWeight(new BigDecimal(decimalFormat.format(platformOrderEntity.getGoodsWeight())));
//                    orderbillInfoVo.setGoodsBaseVo(goodsBaseVo);
//
//                }
//            } else {
//                TruckerOrderEntity truckerOrderEntity = truckerOrderService.selectById(orderId);
//                BeanMapper.copy(truckerOrderEntity, orderbillInfoVo);
//                goodsEntities = goodsService.selectGoodssByTruckerOrderId(orderId);
//                baseGoods = goodsService.selectBaseGoodsByTruckerOrderId(orderId);
//                if (baseGoods != null) {
//                    BeanMapper.copy(baseGoods, goodsBaseVo);
//                    goodsBaseVo.setName(truckerOrderEntity.getGoodsName());
//                    goodsBaseVo.setWeight(new BigDecimal(decimalFormat.format(truckerOrderEntity.getGoodsWeight())));
//                    goodsBaseVo.setLeftWeight(new BigDecimal(decimalFormat.format(truckerOrderEntity.getGoodsWeight())));
//                    orderbillInfoVo.setGoodsBaseVo(goodsBaseVo);
//
//                }
//            }
//
//            List<GoodsInfoVo> goodsInfoVos = BeanMapper.mapList(goodsEntities, GoodsInfoVo.class);
//
//            //货品列表
//
//            if (baseGoods != null) {
//                TransportEntity transportEtity = transportService.selectById(baseGoods.getTransportId());
//                if (transportEtity != null) {
//                    AddressEntity fAddressEntity = addressService.selectById(transportEtity.getFromUserAddressId());
//                    AddressEntity tAddressEntity = addressService.selectById(transportEtity.getToUserAddressId());
//                    orderbillInfoVo.setAddressFrom(fAddressEntity);
//                    orderbillInfoVo.setAddresTo(tAddressEntity);
//                    BeanMapper.copy(transportEtity, orderbillInfoVo);
//                    orderbillInfoVo.setUnloadPlanDateStr(DateFormatUtils.formatDate(transportEtity.getUnloadPlanDate(), "yyyy-MM-dd HH:mm:ss"));
//                    // orderbillInfoVo.setUnloadRealDateStr(DateFormatUtils.formatDate(transportEtity.getUnloadRealDate(),"yyyy-MM-dd HH:mm:ss"));
//                    orderbillInfoVo.setTakePlanDateStr(DateFormatUtils.formatDate(transportEtity.getTakePlanDate(), "yyyy-MM-dd HH:mm:ss"));
//                    //orderbillInfoVo.setTakeRealDateStr(DateFormatUtils.formatDate(transportEtity.getTakeRealDate(),"yyyy-MM-dd HH:mm:ss"));
//                }
//
//            }
//            orderbillInfoVo.setGoodsInfoVoS(goodsInfoVos);
//
//            return ResultData.result(true).setData(orderbillInfoVo);
//        } catch (Exception e) {
//            logger.error("[OrderTruckerController]<== method[truckerOrderInfo], 查询详情 :[{}]", e.getMessage());
//            e.printStackTrace();
//            return ResultData.result(false).setData(e);
//        }
//    }
//
//
//    /**
//     * 更新订单 运单状态
//     *
//     * @param
//     * @return
//     */
//    @PostMapping(value = "updateTruckerOrderStatus")
//    public ResultData updateTruckerOrderStatus(HttpServletRequest request) {
//        try {
//            String receivePostJson = RequestUtil.receivePostJson(request);
//            ChangeStatusVo changeStatusVo = GsonQuick.toObject(receivePostJson, ChangeStatusVo.class);
//            //更新状态
//            truckerOrderService.updateTruckerOrderStatus(changeStatusVo);
//            return ResultData.result(true);
//        } catch (Exception e) {
//            logger.error("[OrderTruckerController]<== method[updateTruckerOrderStatus], 更新状态失败 :[{}]", e.getMessage());
//            e.printStackTrace();
//            return ResultData.result(false).setData(e);
//        }
//    }
//
//
//    /**
//     * @param request
//     * @param response
//     * @return ResultData 返回类型
//     * @throws
//     * @Title logisticsBargain
//     * @Description 上传提货单，并确认提货
//     */
//    @PostMapping(value = "truckerOrderTakeGoods")
//    public ResultData truckerOrderTakeGoods(HttpServletRequest request, HttpServletResponse response) {
//        String receivePostJson = RequestUtil.receivePostJson(request);
//        TruckerBackVo truckerBackVo = GsonQuick.toObject(receivePostJson, TruckerBackVo.class);
//        try {
//            if (StringUtils.isBlank(truckerBackVo.getId())) {
//                return ResultData.result(false).setCode(MsgCode.ADDRESS_FAIL_IS_NOT_EXIST).setMsg(MsgCode.ADDRESS_FAIL_IS_NOT_EXIST_DESC);
//            }
//            if (StringUtils.isBlank(truckerBackVo.getDeliveryOrderUrl())) {
//                return ResultData.result(false).setCode(MsgCode.DELIVERY_ORDER_URL_NOT_EXIST).setMsg(MsgCode.DELIVERY_ORDER_URL_NOT_EXIST_DESC);
//            }
//            TruckerOrderEntity truckerOrderEntity = truckerOrderService.selectById(truckerBackVo.getId());
//            //判断是不是已接单的状态
//            if (!StringUtils.equals(Constants.ORDER_WAITING_PICK_UP_GOODS, truckerOrderEntity.getStatusCode())) {
//                return ResultData.result(false).setCode(MsgCode.ORDER_DATA_ERROR).setMsg(MsgCode.ORDER_DATA_ERROR_DESC);
//            }
//            //truckerOrderEntity.setStatusCode(Constants.ORDER_IN_TRANSIT);
//            //truckerOrderEntity.setStatusCodeDesc("运输中");
//            truckerOrderEntity.setStatusCode(truckerBackVo.getStatusCode());
//            truckerOrderEntity.setStatusCodeDesc(truckerBackVo.getStatusCodeDesc());
//            truckerOrderEntity.setDeliveryOrderUrl(truckerBackVo.getDeliveryOrderUrl());
//            truckerOrderService.insertOrUpdate(truckerOrderEntity);
//            return ResultData.result(true);
//        } catch (Exception e) {
//            logger.error("[OrderLogisticsController]<== method[logisticsTakeGoods],上传提货单，并确认提货 失败 :[{}]", e.getMessage());
//            e.printStackTrace();
//            return ResultData.result(false).setData(e);
//        }
//    }
//
//    /**
//     * @param request
//     * @param response
//     * @return ResultData 返回类型
//     * @throws
//     * @Title logisticsBargain
//     * @Description 上传回执单，等待审核
//     */
//    @PostMapping(value = "truckerOrderTakeReceipt")
//    public ResultData truckerOrderTakeReceipt(HttpServletRequest request, HttpServletResponse response) {
//        String receivePostJson = RequestUtil.receivePostJson(request);
//        TruckerBackVo truckerBackVo = GsonQuick.toObject(receivePostJson, TruckerBackVo.class);
//        try {
//            if (StringUtils.isBlank(truckerBackVo.getId())) {
//                return ResultData.result(false).setCode(MsgCode.ADDRESS_FAIL_IS_NOT_EXIST).setMsg(MsgCode.ADDRESS_FAIL_IS_NOT_EXIST_DESC);
//            }
//            if (StringUtils.isBlank(truckerBackVo.getReceiptUrl())) {
//                return ResultData.result(false).setCode(MsgCode.RECEIPT_URL_NOT_EXIST).setMsg(MsgCode.RECEIPT_URL_NOT_EXIST_DESC);
//            }
//            TruckerOrderEntity truckerOrderEntity = truckerOrderService.selectById(truckerBackVo.getId());
//            //判断是不是运输中
//            if (!StringUtils.equals(Constants.ORDER_IN_TRANSIT, truckerOrderEntity.getStatusCode())) {
//                return ResultData.result(false).setCode(MsgCode.ORDER_DATA_ERROR).setMsg(MsgCode.ORDER_DATA_ERROR_DESC);
//            }
//            //truckerOrderEntity.setStatusCode(Constants.ORDER_WAIT_FOR_CONFIRMATION);
//            // truckerOrderEntity.setStatusCodeDesc("待确认");
//            truckerOrderEntity.setStatusCode(truckerBackVo.getStatusCode());
//            truckerOrderEntity.setStatusCodeDesc(truckerBackVo.getStatusCodeDesc());
//            truckerOrderEntity.setReceiptUrl(truckerBackVo.getReceiptUrl());
//            truckerOrderService.insertOrUpdate(truckerOrderEntity);
//            return ResultData.result(true);
//        } catch (Exception e) {
//            logger.error("[OrderLogisticsController]<== method[logisticsTakeGoods],上传提货单，并确认提货 失败 :[{}]", e.getMessage());
//            e.printStackTrace();
//            return ResultData.result(false).setData(e);
//        }
//    }
//
//    /**
//     * @param request
//     * @param response
//     * @return ResultData 返回类型
//     * @throws
//     * @Title logisticsBargain
//     * @Description 审核运单
//     */
//    @PostMapping(value = "truckerOrderAudit")
//    public ResultData truckerOrderAudit(HttpServletRequest request, HttpServletResponse response) {
//        String receivePostJson = RequestUtil.receivePostJson(request);
//        TruckerBackVo truckerBackVo = GsonQuick.toObject(receivePostJson, TruckerBackVo.class);
//        try {
//
//            if (StringUtils.isBlank(truckerBackVo.getId())) {
//                return ResultData.result(false).setCode(MsgCode.ADDRESS_FAIL_IS_NOT_EXIST).setMsg(MsgCode.ADDRESS_FAIL_IS_NOT_EXIST_DESC);
//            }
//            TruckerOrderEntity truckerOrderEntity = truckerOrderService.selectById(truckerBackVo.getId());
//            //判断是不是运输中
//            if (!StringUtils.equals(Constants.ORDER_WAIT_FOR_CONFIRMATION, truckerOrderEntity.getStatusCode())) {
//                return ResultData.result(false).setCode(MsgCode.ORDER_DATA_ERROR).setMsg(MsgCode.ORDER_DATA_ERROR_DESC);
//            }
//            truckerOrderEntity.setStatusCode(truckerBackVo.getStatusCode());
//            truckerOrderEntity.setStatusCodeDesc(truckerBackVo.getStatusCodeDesc());
//            truckerOrderService.insertOrUpdate(truckerOrderEntity);
//            return ResultData.result(true);
//        } catch (Exception e) {
//            logger.error("[OrderLogisticsController]<== method[logisticsTakeGoods],上传提货单，并确认提货 失败 :[{}]", e.getMessage());
//            e.printStackTrace();
//            return ResultData.result(false).setData(e);
//        }
//    }
//
//    /**
//     * @param request
//     * @param response
//     * @return ResultData 返回类型
//     * @throws
//     * @Title logisticsBargain
//     * @Description 接单 驳回
//     */
//    @PostMapping(value = "truckerOrderReject")
//    public ResultData truckerOrderReject(HttpServletRequest request, HttpServletResponse response) {
//
//        try {
//            String receivePostJson = RequestUtil.receivePostJson(request);
//            OrderBiddingVo platformOrderBiddingVo = GsonQuick.toObject(receivePostJson, OrderBiddingVo.class);
//
//            Date now = new Date();
//            //公司指派来的单 (接单,驳回)
//            String orderType = platformOrderBiddingVo.getOrderType();
//            Integer status = platformOrderBiddingVo.getStatus();
//            if (Constants.USER_TYPE_OUTSIDE_COMPANY.equals(orderType)) {
//                LogisticsOrderEntity logisticsOrderEntity = logisticsOrderServices.selectById(platformOrderBiddingVo.getOrderId());
//                if (logisticsOrderEntity == null) ResultData.result(true);
//
//                logisticsOrderEntity.setStatusCode(String.valueOf(status));
//                logisticsOrderEntity.setStatusCodeDesc(platformOrderBiddingVo.getStatusCodeDesc());
//                logisticsOrderEntity.setCarrierId(platformOrderBiddingVo.getCarrierId());
//                logisticsOrderEntity.setCarrierName(platformOrderBiddingVo.getCarrierName());
//                logisticsOrderEntity.setCarrierMobile(platformOrderBiddingVo.getCarrierMobile());
//                logisticsOrderEntity.setRemarks(platformOrderBiddingVo.getRemarks());
//                Double carriage = logisticsOrderEntity.getCarriage();
//                if (carriage != null && carriage > 0) {
//                    logisticsOrderEntity.setCarriage(carriage);
//                }
//                logisticsOrderEntity.setUpdateTime(now);
//                logisticsOrderServices.insertOrUpdate(logisticsOrderEntity);
//                //补充数据用户id
//                platformOrderBiddingVo.setUserId(logisticsOrderEntity.getUserId());
//                platformOrderBiddingVo.setUserType(Constants.USER_TYPE_OUTSIDE_COMPANY);
//                platformOrderBiddingVo.setCarriage(logisticsOrderEntity.getCarriage());
//                platformOrderBiddingVo.setAmount(logisticsOrderEntity.getAmount());
//                //如果是接单 需要创建订单  待提货
//                if (!Constants.ORDER_STATUS_REFUSE_ORDER.equals(String.valueOf(status))) {
//                    platformOrderBiddingVo.setStatus(Constants.ORDER_STATUS_CODE_TAKE_GOODS);
//                    platformOrderBiddingVo.setStatusCodeDesc("待提货");
//                    platformOrderBiddingVo.setGoodsName(logisticsOrderEntity.getGoodsName());
//                    platformOrderBiddingVo.setGoodsWeight(logisticsOrderEntity.getGoodsWeight());
//                    platformOrderBiddingVo.setCarriage(logisticsOrderEntity.getCarriage());
//                    platformOrderBiddingVo.setAmount(logisticsOrderEntity.getAmount());
//                    truckerOrderService.creatTruckerOrderBeforLogisticsOrder(platformOrderBiddingVo);
//                }
//
//            }
//
//            //平台指派来的单 (接单,驳回)
//            if (Constants.USER_TYPE_OUTSIDE_PLATFORM.equals(orderType)) {
//                PlatformOrderEntity platformOrderEntity = platformOrderService.selectById(platformOrderBiddingVo.getOrderId());
//                if (platformOrderEntity == null) ResultData.result(true);
//                platformOrderEntity.setStatusCode(String.valueOf(status));
//                platformOrderEntity.setStatusCodeDesc(platformOrderBiddingVo.getStatusCodeDesc());
//                platformOrderEntity.setCarrierId(platformOrderBiddingVo.getCarrierId());
//                platformOrderEntity.setCarrier(platformOrderBiddingVo.getCarrierName());
//                platformOrderEntity.setCarrierMobile(platformOrderBiddingVo.getCarrierMobile());
//                platformOrderEntity.setRemarks(platformOrderBiddingVo.getRemarks());
//                Double carriage = platformOrderEntity.getCarriage();
//                if (carriage != null && carriage > 0) {
//                    platformOrderEntity.setCarriage(carriage);
//                }
//                platformOrderEntity.setUpdateTime(now);
//                platformOrderService.insertOrUpdate(platformOrderEntity);
//                platformOrderBiddingVo.setGoodsName(platformOrderEntity.getGoodsName());
//                platformOrderBiddingVo.setGoodsWeight(platformOrderEntity.getGoodsWeight());
//                platformOrderBiddingVo.setUserId(platformOrderEntity.getUserId());
//                platformOrderBiddingVo.setUserType(Constants.USER_TYPE_OUTSIDE_PLATFORM);
//                //如果是接单 需要创建订单  待提货
//                if (!Constants.ORDER_STATUS_REFUSE_ORDER.equals(String.valueOf(status))) {
//                    platformOrderBiddingVo.setStatus(Constants.ORDER_STATUS_CODE_TAKE_GOODS);
//                    platformOrderBiddingVo.setStatusCodeDesc("待提货");
//                    platformOrderBiddingVo.setCarriage(platformOrderEntity.getCarriage());
//                    platformOrderBiddingVo.setAmount(platformOrderEntity.getAmount());
//                    truckerOrderService.creatTruckerOrderBeforePlatformOrder(platformOrderBiddingVo);
//                }
//            }
//
//
//            return ResultData.result(true);
//        } catch (Exception e) {
//            logger.error("[OrderLogisticsController]<== method[logisticsTakeGoods],上传提货单，并确认提货 失败 :[{}]", e.getMessage());
//            e.printStackTrace();
//            return ResultData.result(false).setData(e);
//        }
//    }
//
//
//}
